#!/usr/bin/python
#Filename: objvar.py

class People:
	population = 0;
	def __init__(self, name = 'Yin Lijun'):
		self.name = name
		People.population += 1
	
	def __del__(self):
		People.population -= 1
		if(People.population == 0):
			print 'I am %s the last one' %self.name
		else:
			print 'Goodbye I am %s, There are still %d people' %(self.name, People.population)
	
	def sayhi(self):
		print 'Hi, my name is %s' %self.name

	def howmany(self):
		print 'There are %d people' %People.population
p1 = People('Hance')
p1.sayhi()
p1.howmany()

p2 = People('XieErgai')
p2.sayhi()
p2.howmany()

p3 = People()
p3.sayhi()
p3.howmany()

del p1
